This is one page of the R Handbook for Epidemiologists, but is being printed as a stand-alone page.

You can find the complete handbook on Github

Transmission Chains

Overview

The primary tool to visualize and analyze transmission chains is the package epicontacts, developed by the folks at RECON.

Preparation

Visualization


links <- epicontacts::make_epicontacts(linelist = mers_korea_2015$linelist,
                                       contacts = mers_korea_2015$contacts, 
                                       directed = TRUE)
# plot without time
plot(links,
     selector = FALSE,
     height = 700,
     width = 700)

And in a transmission tree, with date of onset on the x-axis:

Note: this currently requires installing a development version of epicontacts from github… @ttree


# plot with date of onset as x-axis
plot(sim,
     x_axis = 'onset',
     height = 700,
     width = 700,
)

Analysis

summary(links)
## 
## /// Overview //
##   // number of unique IDs in linelist: 162
##   // number of unique IDs in contacts: 97
##   // number of unique IDs in both: 97
##   // number of contacts: 98
##   // contacts with both cases in linelist: 100 %
## 
## /// Degrees of the network //
##   // in-degree summary:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.0000  1.0000  0.6049  1.0000  3.0000 
## 
##   // out-degree summary:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.0000  0.0000  0.6049  0.0000 38.0000 
## 
##   // in and out degree summary:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.00    1.00    1.21    1.00   39.00 
## 
## /// Attributes //
##   // attributes in linelist:
##  age age_class sex place_infect reporting_ctry loc_hosp dt_onset dt_report week_report dt_start_exp dt_end_exp dt_diag outcome dt_death
## 
##   // attributes in contacts:
##  exposure diff_dt_onset

Resources

This tab should stay with the name “Resources”. Links to other online tutorials or resources.